<?php


namespace app\mod\pcr\model;


use think\Model;

class PcrGveGroupMember extends Model {

    const STATUS_NORMAL = 0;

    protected $table = 'pcr_gve_group_member';

    public function getByGroupUserId(int $group_id, int $user_id) {
        return $this->where('group_id', $group_id)->where('user_id', $user_id)->find();
    }

    public function getListInTheTree(int $group_id, int $user_id) {
        return $this
            ->where('group_id', $group_id)
            ->where('user_id', $user_id)
            ->where('flag_tree', 1)->select();
    }

}
